import Vue from 'vue'
import { requst, requst2, requst3 } from '@/http/request.js'
import { getUInfo, timestampToDateFormat } from '@/util/util.js'

// 获取验证码
Vue.prototype.$getSmsCode = (prms) => {
	return requst('/api/sms/send', prms, 'POST')
}

// 登录 
Vue.prototype.$login = (prms) => {
	return requst('/api/user/mobilelogin', prms, 'POST', { 'content-type': 'application/x-www-form-urlencoded' })
	// return requst('/api/anzhuang/mobilelogin', prms, 'POST', { 'content-type': 'multipart/form-data' })
}

// 根据物流公司名称查询
Vue.prototype.$getLogList = (prms) => {
	return requst('/api/logistics/getList', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 根据发站到站查询 api/logistics/getSiteList?site_name=临沂&unload_name=泗水
Vue.prototype.$getSiteList = (prms) => {
	return requst('/api/logistics/getSiteList', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 物流详情 
Vue.prototype.$getLogInfo = (prms) => {
	return requst('/api/logistics/getinfo', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 物流园区 
Vue.prototype.$getPark = (prms) => {
	return requst('/api/index/getPark', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 地址列表 
Vue.prototype.$getAddressList = (prms) => {
	return requst('/api/user/getAddress', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 添加地址 
Vue.prototype.$addAddress = (prms) => {
	return requst('/api/user/addAddress', prms, 'POST', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 删除地址 
Vue.prototype.$delAddress = (prms) => {
	return requst('/api/user/delAddress', prms, 'POST', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 签到 
Vue.prototype.$sign = (prms) => {
	return requst('/api/user/leesign', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 浏览 
Vue.prototype.$browse = (prms) => {
	return requst('/api/user/browse', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 浏览记录 
Vue.prototype.$browsRecord = (prms) => {
	return requst('/api/user/getBrowse', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 物流公司订单 
Vue.prototype.$getCompanyOrder = (prms) => {
	return requst('/api/user/getCompanyOrder', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 订单详情 
Vue.prototype.$getOrderInfo = (prms) => {
	return requst('/api/user/getOrderInfo', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 接单 
Vue.prototype.$receiveOrder = (prms) => {
	return requst('/api/order/receive', prms, 'POST', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 填写TMS系统运单号 
Vue.prototype.$postPlatform = (prms) => {
	return requst('/api/order/platform', prms, 'POST', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 下单 
Vue.prototype.$createOrder = (prms) => {
	return requst('/api/order/createOrder', prms, 'POST', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 我的订单 
Vue.prototype.$getOrderList = (prms) => {
	return requst('/api/user/getOrderList', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}


// 快捷下单,推送到车满满系统 
Vue.prototype.$createCmmOrder = (prms) => {
	return requst('/api/order/cmmOrder', prms, 'POST', { 'content-type': 'application/x-www-form-urlencoded' })
}

// 快捷下单,只到本地系统,不到车满满
Vue.prototype.$createCmmOrder2 = (prms) => {
	return requst2('/api/order/cmmOrder', prms, 'POST', { 'content-type': 'application/x-www-form-urlencoded' })
}

// /api/index/getCmmOrder?order_sn=zs250921906
// 测试下单,微信客服
Vue.prototype.$demoCmmOrder = (prms) => {
	return requst3('/api/index/getCmmOrder', prms, 'GET', { 'content-type': 'application/x-www-form-urlencoded' })
}